// /js/config/api.js
window.API_CONFIG = {
    BASE_URL: '/pms',
    ENDPOINTS: {
        LOGIN: '/pms/login',
        LOGOUT: '/pms/logout',
        REFRESH_TOKEN: '/pms/refresh_token',
        VALIDATE_TOKEN: '/pms/validate-token',

        // 用户相关
        USER_PROFILE: '/pms/user/profile',
        CHANGE_PASSWORD: '/pms/user/change-password',

        // 会话管理
        SESSIONS: '/pms/sessions',
        TERMINATE_SESSION: '/pms/sessions/terminate',
        TERMINATE_OTHER_SESSIONS: '/pms/sessions/terminate-others',

        // 统计相关
        PROJECT_DIFF: '/pms/statistics/project/diff',
        PROJECT_DIFF_DETAIL: '/pms/statistics/project/diff/detail',

        // 设计相关
        GET_ORG_LIST: '/pms/design/GetOrgList',
        CHECK_USER_ROLE: '/pms/design/CheckUserRole',
        GET_NORM_LABOR: '/pms/design/GetNormLabor',
        GET_NORM_CONVERSION: '/pms/design/GetNormConversion',
        GET_NORM_MATERIAL: '/pms/design/GetNormMaterial',
        GET_MATERIAL_PRICE: '/pms/design/GetMaterialPrice',
        GET_PROJECT_REVIEWER: '/pms/design/GetProjectReviewer',
        CREATE_PROJECT: '/pms/design/CreateProject',
        CREATE_FROM: '/pms/design/CreateFrom',
        GET_PROJECT_BASE: '/pms/design/GetProjectBase',
        UPDATE_PROJECT_BASE: '/pms/design/UpdateProjectBase',
        GET_PROJECT_RESUME: '/pms/design/GetProjectResume',
        PROJECT_LIST: '/pms/design/ProjectList',
        FILE_PROJECT: '/pms/design/FileProject',
        LOAD_LABOR: '/pms/design/LoadLabor',
        LOAD_MATERIAL: '/pms/design/LoadMaterial',
        LOAD_OTHER_FEE: '/pms/design/LoadOtherFee',
        SAVE_LABOR: '/pms/design/SaveLabor',
        SAVE_MATERIAL: '/pms/design/SaveMaterial',
        SAVE_OTHER_FEE: '/pms/design/SaveOtherFee',
        SAVE_TABLE: '/pms/design/SaveTable',
        EXPORT_PROJECT: '/pms/design/ExportProject',
        IMPORT_PROJECT: '/pms/design/ImportProject',
        GET_PROJECT_BALANCE: '/pms/design/GetProjectBalance',
        GET_PROJECT_OUTBOUND: '/pms/design/GetProjectOutbound',
    },
    ADMIN: {
        BASE_URL: '/admin',
        USERS: '/admin/users',
        STATS: '/admin/stats',
        SESSIONS: '/admin/sessions',
        PROJECTS: '/admin/projects',
        ROLES: '/admin/roles',
        GENERATE_USER_ID: '/admin/generate-user-id',
        RESET_PASSWORD: '/admin/reset-password',
        FREEZE_USER: '/admin/freeze-user',
        UNFREEZE_USER: '/admin/unfreeze-user',
    },
    ROLE: {
        Admin: 'admin', // 管理员
        Designer: 'designer', // 方案设计
        DesignReviewer: 'design_reviewer', // 方案设计审核
        Accepter: 'accepter', // 方案验收
        AcceptReviewer: 'accept_reviewer', // 方案验收审核
        Client: 'client', // 客户
    },
    DESIGNTYPE: {
        All: 0, // 所有
        Budget: 1, // 预算
        Settlement: 2, // 结算
        Audit: 3, // 审计
    },
    PROJECT_STATE: {
        All: 0, // 所有项目状态
        ToBudget: 1, // 待设计预算（预算未存档）
        ToAccept: 2, // 待验收（预算已存档，待出具结算）
        ToAudit: 3, // 待审计（结算已存档，待审计）
        Completed: 4, // 已完审（审计已存档）
    }
};
